<%-- 
    Document   : index
    Created on : Jan 2, 2012, 4:08:02 PM
    Author     : user
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">

<%@include file="../jspf/header.jspf" %>


<div>
    <div style="width: 100%">
        <p class="pageTitle"><strong>Finalizeaza comanda</strong></p>
        <br />
        <div class="txt1" style="width: 100%"><b>Produse comandate</b>
            <hr />
        </div>

        <%@include file="../jspf/message.jspf" %>

        <div style="width: 100%; padding: 10px 0px 10px 0px">



            <table style="width: 100%" class="data">
                <tr>
                    <th><input name="hProduct" id="hProduct" value="Produs" class="large"
                               readonly="readonly" /></th>
                    <th><input name="hQuantity" id="hQuantity" value="Cantitate"
                               readonly="readonly" /></th>
                    <th><input name="hPrice" id="hPrice" value="Pret" readonly="readonly" /></th>
                    <th><input class="large" name="hSubtotal" id="hSubtotal"
                               value="Subtotal" readonly="readonly" /></th>
                </tr>

                <%
                            try {
                                ArrayList cart = (ArrayList) session.getAttribute(Static.cart);
                                int s = cart.size();
                                float totalPrice = 0;

                                for (int i = 0; i < s; i++) {
                                    HashMap p = (HashMap) cart.get(i);
                                    out.print("<tr><td>");
                                    out.print("<input class=\"large\" name=\"Product\" id=\"Product\" Title=\"" + p.get("Name") + "\" value=\"" + p.get("Name") + "\" readonly=\"readonly\" />");
                                    out.print("</td><td>");
                                    out.print("<input  name=\"Quantity\" id=\"Quantity\" Title=\"" + p.get("Quantity") + "\" value=\"" + p.get("Quantity") + "\" readonly=\"readonly\" />");
                                    out.print("</td><td>");
                                    out.print("<input name=\"Price\" id=\"Price\" Title=\"" + p.get("Price") + "\" value=\"" + p.get("Price") + "\" readonly=\"readonly\" />");
                                    out.print("</td><td>");
                                    out.print("<input class=\"large\" name=\"Subtotal\" id=\"Subtotal\" Title=\"" + Float.parseFloat(p.get("Quantity").toString()) * Float.parseFloat(p.get("Price").toString()) + "\" value=\"" + Float.parseFloat(p.get("Quantity").toString()) * Float.parseFloat(p.get("Price").toString()) + "\" readonly=\"readonly\" />");
                                    out.print("</td></tr>");
                                    totalPrice += +Float.parseFloat(p.get("Quantity").toString()) * Float.parseFloat(p.get("Price").toString());
                                }

                                out.print("<tr><th></th><th></th><th><input  name=\"hTotal\" id=\"hTotal\" Title=\"Total\" value=\"Total\" readonly=\"readonly\" /></th>");
                                out.print("<th><input class=\"large\" name=\"Total\" id=\"Total\" Title=\"" + totalPrice + "\" value=\"" + totalPrice + "\" readonly=\"readonly\" /></th></tr>");

                            } catch (Exception ex) {
                                out.print(ex.getMessage());
                            }

                            HashMap customer = (HashMap) session.getAttribute(Static.customer);

                %>
            </table>
        </div>

        <div class="txt1" style="width: 100%; margin-top: 50px;"><b>Informatii
                livrare:</b>
            <hr />
        </div>
        <div style="width: 100%; padding: 10px 0px 10px 0px">
            <table class="tableInfo txt1">
                <tr>
                    <td class="tableInfo c1"><b>Nume:</b></td>
                    <td class="tableInfo c2">&nbsp;</td>
                    <td class="tableInfo c3"><b><% out.print(customer.get("Name"));%></b></td>
                </tr>
                <tr>
                    <td class="tableInfo c1"><b>Prenume:</b></td>
                    <td class="tableInfo c2">&nbsp;</td>
                    <td class="tableInfo c3"><b><% out.print(customer.get("Surname"));%></b></td>
                </tr>
                <tr>
                    <td class="tableInfo c1"><b>Telefon:</b></td>
                    <td class="tableInfo c2">&nbsp;</td>
                    <td class="tableInfo c3"><b><%



                                if (customer.get(
                                        "Phone") == null) {
                                    out.print("---");
                                } else {
                                    out.println(customer.get("Phone"));
                                }

                            %></b></td>
                </tr>
                <tr>
                    <td class="tableInfo c1"><b>Email:</b></td>
                    <td class="tableInfo c2">&nbsp;</td>
                    <td class="tableInfo c3"><b><%                        if (customer.get(
                                        "Email") == null) {
                                    out.print("---");
                                } else {
                                    out.println(customer.get("Email"));
                                }

                            %></b></td>
                </tr>
                <tr>
                    <td class="tableInfo c1"><b>Adresa:</b></td>
                    <td class="tableInfo c2">&nbsp;</td>
                    <td class="tableInfo c3"><b><%                        try {
                                    if (customer.get("Address") == null) {
                                        out.print("---");
                                    } else {
                                        out.println(customer.get("Address"));
                                    }
                                } catch (Exception ex) {
                                    out.print(ex.getMessage());
                                }

                            %></b></td>
                </tr>
                <tr>
                    <td class="tableInfo c1"><b>Oras:</b></td>
                    <td class="tableInfo c2">&nbsp;</td>
                    <td class="tableInfo c3"><b><%



                                try {
                                    if (customer.get("City") == null) {
                                        out.print("---");
                                    } else {
                                        out.println(customer.get("City"));
                                    }
                                } catch (Exception ex) {
                                    out.print(ex.getMessage());
                                }

                            %></b></td>
                </tr>
                <tr>
                    <td class="tableInfo c1"><b>Judet:</b></td>
                    <td class="tableInfo c2">&nbsp;</td>
                    <td class="tableInfo c3"><b><%



                                try {
                                    if (customer.get("District") == null) {
                                        out.print("---");
                                    } else {
                                        out.println(customer.get("District"));
                                    }
                                } catch (Exception ex) {
                                    out.print(ex.getMessage());
                                }
                            %></b></td>
                </tr>
                <tr>
                    <td class="tableInfo c1"><b>Cod Postal:</b></td>
                    <td class="tableInfo c2">&nbsp;</td>
                    <td class="tableInfo c3"><b><%



                                try {
                                    if (customer.get("PostalCode") == null) {
                                        out.print("---");
                                    } else {
                                        out.println(customer.get("PostalCode"));
                                    }
                                } catch (Exception ex) {
                                    out.print(ex.getMessage());
                                }
                            %>
                        </b></td>
                </tr>
                <tr>
                    <td class="tableInfo c1"><b>Tara:</b></td>
                    <td class="tableInfo c2">&nbsp;</td>
                    <td class="tableInfo c3"><b>Romania</b></td>
                </tr>
            </table>
        </div>
        <div ><a
                style="background: url(img/site/btn_ok.jpg) no-repeat center;"
                class="btn_img" title="Comanda"
                href="order?action=add">Comanda!</a></div>
    </div>
</div>

<%@include file="../jspf/footer.jspf" %>
